HW 1 - Dawid Pludowski

Workspace preparation

importing libraries

Loading model and test data

Please note that train data is not provided here as model was trained in different noebook to remove redundant code.

Observation explaining

Creating observation object

Choosing two observations

Assuring that model prediction are close to real target value

Model predict target very well, so further explanation can be present.

Creating breakdown and shapley plots for choosen observations

Based on break_down plot, the greatest positive inpact on prediction has total_rooms and longitude. However, longitude without latitude does not create significant information and we may expect that only interaction of that variables really matters in the model.

The greates negative impact has ocean_proximity and latitude. Again, only in interaction latitude create siginifact infromation.

On shap plot, households's impact is positive while on break_down it is negative. It may suggest that interaction between households and other variables exists. We may expect interaction with total_* or population variables, as ratio of that variables tell more about housing in the area than single variables.

While in first observation most variables has negative impact, in the second observation they have mainly positive impact. It is worth mentioning that the greatest negative impact in second observation is observed in households and total_rooms while they have the greatest positive impact in the first observation. The linear positive correlation between target and those two variables should be examinated.

Conclusion

Since values obtained by break_down and shap are different, some interactions in model exist. We can easily find them using break_down_interactions plots:

For each observation the interactions are different; however, we can notice that: